import request from '@/utils/axios';

/// 菜单树
export function getAllMenusApi() {
  return request({
    url: '/admin/system/sysMenu/findNodes',
    method: 'get'
  });
}


export function save(data: any) {
  return request({
    url: '/admin/system/sysMenu/save',
    method: 'post',
    data
  });
}



// 修改信息
export const updateSysMenuById = (sysMenu: any) => {
    return request({
        url: `/admin/system/sysMenu/updateById`,
        method: 'put',
        data: sysMenu,
    })
}

// 根据id删除数据
export const removeSysMenuById = (id: any) => {
    return request({
        url: `/admin/system/sysMenu/removeById/${id}`,
        method: 'delete',
    })
}


// 获取菜单
export const getMenus = (params: any) => {
  return request({
    url: '/admin/system/index/menus',
    method: 'get',
    params,
  })
}